package com.itheima01;

import java.time.LocalDate;
import java.time.Period;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的生日:");
        String s = sc.nextLine();
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
        LocalDate ld = LocalDate.parse(s, dtf);
        System.out.println(ld);
        LocalDate ld2 = LocalDate.now();
        System.out.println(ld2);
        Period between = Period.between(ld, ld2);
        int day = (int) between.toTotalMonths();
        System.out.println(day);


    }
}
